<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">

<title>class WIN32OLE::Typelib - win32ole: Ruby Standard Library Documentation</title>


<script src="../js/navigation.js" defer></script>
<script src="../js/search.js" defer></script>
<script src="../js/search_index.js" defer></script>
<script src="../js/searcher.js" defer></script>
<script src="../js/darkfish.js" defer></script>

<script src="../js/jquery-3.2.0.min.js"></script>

<script src="../js/vue.min.js"></script>
<script src="../js/js.cookie.min.js"></script>

<link href="../css/fonts.css" rel="stylesheet">
<link id='rdoccss' href="../css/rdoc.css" rel="stylesheet">
<link href="../css/carbon17.css" rel="stylesheet">

<script type="text/javascript">
  var rdoc_rel_prefix = "../";
  var index_rel_prefix = "../";
  var darkModeCsseHref = "../css/rdoc-dm.css"
  var defaultModeCssHref = "../css/rdoc.css"
  // var cssDarkmode = Cookies.get('darkmode');
  
  if( Cookies.get("darkmode") == "true") {
	$('#rdoccss').attr("href", darkModeCsseHref);
}

//  https://cssdeck.com/blog/simple-jquery-stylesheet-switcher/

document.write('<style type="text/css">body{display:none}</style>');

</script>


</head>
<body id="top" role="document" class="class">
  <!-- this is class.html -->

  <div id='actionbar' >
    <div class='wrapper mdiv'>
      <ul class='grids g0'></ul>
    </div> 
    <!-- VERSION HEADER for 3.3.0.preview2 NOT FOUND -->
  </div> <!-- end action bar -->

  <div class='wrapper hdiv'>

    


    <nav id='vapp' role="navigation">
    <div id="project-navigation">
      <div id="home-section" role="region" title="Quick navigation" class="nav-section">
  <h2><a href="../index.html" rel="home">Home</a></h2>

  <div id="table-of-contents-navigation"  >
    <a href="../table_of_contents.html#pages">Pages</a>
    <a href="../table_of_contents.html#classes">Classes</a>
    <a href="../table_of_contents.html#methods">Methods</a>
  </div>
</div>

      <div id="search-section" role="search" class="project-section initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <div id="search-field-wrapper">
      <input id="search-field" role="combobox" aria-label="Search"
             aria-autocomplete="list" aria-controls="search-results"
             type="text" name="search" placeholder="Search" spellcheck="false"
             title="Type to search, Up and Down to navigate, Enter to load">
    </div>

    <ul id="search-results" aria-label="Search Results"
        aria-busy="false" aria-expanded="false"
        aria-atomic="false" class="initially-hidden"></ul>
  </form>
</div>

    </div>


    

    <button id='toggleThing' @click="toggleNav()" >Show/hide navigation</button>
    <div :class="isOpen ? 'block' : 'hidden' " id='toggleMe'>
      <div id="class-metadata">
        
        
<div id="parent-class-section" class="nav-section">
  <h3>Parent</h3>

  <p class="link"><a href="../Object.html">Object</a>
</div>

        
        
        
<!-- Method Quickref -->
<div id="method-list-section" class="nav-section">
  <h3>Methods</h3>

  <ul class="link-list" role="directory">
    <li ><a href="#method-c-new">::new</a>
    <li ><a href="#method-c-typelibs">::typelibs</a>
    <li ><a href="#method-i-guid">#guid</a>
    <li ><a href="#method-i-inspect">#inspect</a>
    <li ><a href="#method-i-library_name">#library_name</a>
    <li ><a href="#method-i-major_version">#major_version</a>
    <li ><a href="#method-i-minor_version">#minor_version</a>
    <li ><a href="#method-i-name">#name</a>
    <li ><a href="#method-i-ole_classes">#ole_classes</a>
    <li ><a href="#method-i-ole_types">#ole_types</a>
    <li ><a href="#method-i-path">#path</a>
    <li ><a href="#method-i-to_s">#to_s</a>
    <li ><a href="#method-i-version">#version</a>
    <li ><a href="#method-i-visible-3F">#visible?</a>
  </ul>
</div>

      </div>
     </div>
    </nav>


    <div id='extraz'><div class='adzbox-index'  >
      
     </div>         
    </div>

    <main role="main" aria-labelledby="class-WIN32OLE::Typelib">
    <h1 id="class-WIN32OLE::Typelib" class="class">
      class WIN32OLE::Typelib
    </h1>

    <section class="description">
    
    </section>

      <section id="5Buntitled-5D" class="documentation-section">





                <section id="public-class-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Class Methods</h3>
                </header>

                  <div id="method-c-new" class="method-detail ">
                      <div class="method-heading">
                        <span class="method-callseq">
                          new(typelib [, version1, version2]) &rarr; WIN32OLE_TYPELIB object
                              </span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Returns a new WIN32OLE_TYPELIB object.</p>

<p>The first argument <em>typelib</em>  specifies OLE type library name or GUID or OLE library file. The second argument is major version or version of the type library. The third argument is minor version. The second argument and third argument are optional. If the first argument is type library name, then the second and third argument are ignored.</p>

<pre class="ruby"><span class="ruby-identifier">tlib1</span> = <span class="ruby-constant">WIN32OLE_TYPELIB</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&#39;Microsoft Excel 9.0 Object Library&#39;</span>)
<span class="ruby-identifier">tlib2</span> = <span class="ruby-constant">WIN32OLE_TYPELIB</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&#39;{00020813-0000-0000-C000-000000000046}&#39;</span>)
<span class="ruby-identifier">tlib3</span> = <span class="ruby-constant">WIN32OLE_TYPELIB</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&#39;{00020813-0000-0000-C000-000000000046}&#39;</span>, <span class="ruby-value">1.3</span>)
<span class="ruby-identifier">tlib4</span> = <span class="ruby-constant">WIN32OLE_TYPELIB</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&#39;{00020813-0000-0000-C000-000000000046}&#39;</span>, <span class="ruby-value">1</span>, <span class="ruby-value">3</span>)
<span class="ruby-identifier">tlib5</span> = <span class="ruby-constant">WIN32OLE_TYPELIB</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&quot;C:\\WINNT\\SYSTEM32\\SHELL32.DLL&quot;</span>)
<span class="ruby-identifier">puts</span> <span class="ruby-identifier">tlib1</span>.<span class="ruby-identifier">name</span>  <span class="ruby-comment"># -&gt; &#39;Microsoft Excel 9.0 Object Library&#39;</span>
<span class="ruby-identifier">puts</span> <span class="ruby-identifier">tlib2</span>.<span class="ruby-identifier">name</span>  <span class="ruby-comment"># -&gt; &#39;Microsoft Excel 9.0 Object Library&#39;</span>
<span class="ruby-identifier">puts</span> <span class="ruby-identifier">tlib3</span>.<span class="ruby-identifier">name</span>  <span class="ruby-comment"># -&gt; &#39;Microsoft Excel 9.0 Object Library&#39;</span>
<span class="ruby-identifier">puts</span> <span class="ruby-identifier">tlib4</span>.<span class="ruby-identifier">name</span>  <span class="ruby-comment"># -&gt; &#39;Microsoft Excel 9.0 Object Library&#39;</span>
<span class="ruby-identifier">puts</span> <span class="ruby-identifier">tlib5</span>.<span class="ruby-identifier">name</span>  <span class="ruby-comment"># -&gt; &#39;Microsoft Shell Controls And Automation&#39;</span>
</pre>

                              <div class="method-source-code" id="new-source">
            <pre>static VALUE
foletypelib_initialize(VALUE self, VALUE args)
{
    VALUE found = Qfalse;
    VALUE typelib = Qnil;
    int len = 0;
    OLECHAR * pbuf;
    ITypeLib *pTypeLib;
    HRESULT hr = S_OK;

    len = RARRAY_LEN(args);
    rb_check_arity(len, 1, 3);

    typelib = rb_ary_entry(args, 0);

    SafeStringValue(typelib);

    found = oletypelib_search_registry(self, typelib);
    if (found == Qfalse) {
        found = oletypelib_search_registry2(self, args);
    }
    if (found == Qfalse) {
        pbuf = ole_vstr2wc(typelib);
        hr = LoadTypeLibEx(pbuf, REGKIND_NONE, &amp;pTypeLib);
        SysFreeString(pbuf);
        if (SUCCEEDED(hr)) {
            found = Qtrue;
            oletypelib_set_member(self, pTypeLib);
        }
    }

    if (found == Qfalse) {
        rb_raise(eWIN32OLERuntimeError, &quot;not found type library `%s`&quot;,
                 StringValuePtr(typelib));
    }
    return self;
}</pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-typelibs" class="method-detail ">
                      <div class="method-heading">
                        <span class="method-callseq">
                          typelibs
                              </span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Returns the array of WIN32OLE_TYPELIB object.</p>

<pre class="ruby"><span class="ruby-identifier">tlibs</span> = <span class="ruby-constant">WIN32OLE_TYPELIB</span>.<span class="ruby-identifier">typelibs</span>
</pre>

                              <div class="method-source-code" id="typelibs-source">
            <pre>static VALUE
foletypelib_s_typelibs(VALUE self)
{
    HKEY htypelib, hguid;
    DWORD i, j;
    LONG err;
    VALUE guid;
    VALUE version;
    VALUE name = Qnil;
    VALUE typelibs = rb_ary_new();
    VALUE typelib = Qnil;
    HRESULT hr;
    ITypeLib *pTypeLib;

    err = reg_open_key(HKEY_CLASSES_ROOT, &quot;TypeLib&quot;, &amp;htypelib);
    if(err != ERROR_SUCCESS) {
        return typelibs;
    }
    for(i = 0; ; i++) {
        guid = reg_enum_key(htypelib, i);
        if (guid == Qnil)
            break;
        err = reg_open_vkey(htypelib, guid, &amp;hguid);
        if (err != ERROR_SUCCESS)
            continue;
        for(j = 0; ; j++) {
            version = reg_enum_key(hguid, j);
            if (version == Qnil)
                break;
            if ( (name = reg_get_val2(hguid, StringValuePtr(version))) != Qnil ) {
                hr = oletypelib_from_guid(guid, version, &amp;pTypeLib);
                if (SUCCEEDED(hr)) {
                    typelib = create_win32ole_typelib(pTypeLib);
                    rb_ary_push(typelibs, typelib);
                }
            }
        }
        RegCloseKey(hguid);
    }
    RegCloseKey(htypelib);
    return typelibs;
}</pre>
                              </div>
                            </div>


                          </div>

                          </section>

                <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Instance Methods</h3>
                </header>

                  <div id="method-i-guid" class="method-detail ">
                      <div class="method-heading">
                        <span class="method-callseq">
                          WIN32OLE_TYPELIB#guid &rarr; The guid string.
                              </span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Returns guid string which specifies type library.</p>

<pre class="ruby"><span class="ruby-identifier">tlib</span> = <span class="ruby-constant">WIN32OLE_TYPELIB</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&#39;Microsoft Excel 9.0 Object Library&#39;</span>)
<span class="ruby-identifier">guid</span> = <span class="ruby-identifier">tlib</span>.<span class="ruby-identifier">guid</span> <span class="ruby-comment"># -&gt; &#39;{00020813-0000-0000-C000-000000000046}&#39;</span>
</pre>

                              <div class="method-source-code" id="guid-source">
            <pre>static VALUE
foletypelib_guid(VALUE self)
{
    ITypeLib *pTypeLib;
    OLECHAR bstr[80];
    VALUE guid = Qnil;
    int len;
    TLIBATTR *pTLibAttr;

    pTypeLib = itypelib(self);
    oletypelib_get_libattr(pTypeLib, &amp;pTLibAttr);
    len = StringFromGUID2(&amp;pTLibAttr-&gt;guid, bstr, sizeof(bstr)/sizeof(OLECHAR));
    if (len &gt; 3) {
        guid = ole_wc2vstr(bstr, FALSE);
    }
    pTypeLib-&gt;lpVtbl-&gt;ReleaseTLibAttr(pTypeLib, pTLibAttr);
    return guid;
}</pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-inspect" class="method-detail ">
                      <div class="method-heading">
                        <span class="method-callseq">
                          WIN32OLE_TYPELIB#inspect &rarr; String
                              </span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Returns the type library name with class name.</p>

<pre class="ruby"><span class="ruby-identifier">tlib</span> = <span class="ruby-constant">WIN32OLE_TYPELIB</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&#39;Microsoft Excel 9.0 Object Library&#39;</span>)
<span class="ruby-identifier">tlib</span>.<span class="ruby-identifier">inspect</span> <span class="ruby-comment"># =&gt; &quot;&lt;#WIN32OLE_TYPELIB:Microsoft Excel 9.0 Object Library&gt;&quot;</span>
</pre>

                              <div class="method-source-code" id="inspect-source">
            <pre>static VALUE
foletypelib_inspect(VALUE self)
{
    return default_inspect(self, &quot;WIN32OLE_TYPELIB&quot;);
}</pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-library_name" class="method-detail ">
                      <div class="method-heading">
                        <span class="method-callseq">
                          WIN32OLE_TYPELIB#library_name
                              </span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Returns library name. If the method fails to access library name, <a href="../WIN32OLERuntimeError.html"><code>WIN32OLERuntimeError</code></a> is raised.</p>

<pre class="ruby"><span class="ruby-identifier">tlib</span> = <span class="ruby-constant">WIN32OLE_TYPELIB</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&#39;Microsoft Excel 9.0 Object Library&#39;</span>)
<span class="ruby-identifier">tlib</span>.<span class="ruby-identifier">library_name</span> <span class="ruby-comment"># =&gt; Excel</span>
</pre>

                              <div class="method-source-code" id="library_name-source">
            <pre>static VALUE
foletypelib_library_name(VALUE self)
{
    HRESULT hr;
    ITypeLib *pTypeLib = NULL;
    VALUE libname = Qnil;
    BSTR bstr;

    pTypeLib = itypelib(self);
    hr = pTypeLib-&gt;lpVtbl-&gt;GetDocumentation(pTypeLib, -1,
                                            &amp;bstr, NULL, NULL, NULL);
    if (FAILED(hr)) {
        ole_raise(hr, eWIN32OLERuntimeError, &quot;failed to get library name&quot;);
    }
    libname = WC2VSTR(bstr);
    return libname;
}</pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-major_version" class="method-detail ">
                      <div class="method-heading">
                        <span class="method-callseq">
                          WIN32OLE_TYPELIB#major_version &rarr; The type library major version.
                              </span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Returns the type library major version.</p>

<pre class="ruby"><span class="ruby-identifier">tlib</span> = <span class="ruby-constant">WIN32OLE_TYPELIB</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&#39;Microsoft Excel 9.0 Object Library&#39;</span>)
<span class="ruby-identifier">puts</span> <span class="ruby-identifier">tlib</span>.<span class="ruby-identifier">major_version</span> <span class="ruby-comment"># -&gt; 1</span>
</pre>

                              <div class="method-source-code" id="major_version-source">
            <pre>static VALUE
foletypelib_major_version(VALUE self)
{
    TLIBATTR *pTLibAttr;
    VALUE major;
    ITypeLib *pTypeLib;
    pTypeLib = itypelib(self);
    oletypelib_get_libattr(pTypeLib, &amp;pTLibAttr);

    major =  RB_INT2NUM(pTLibAttr-&gt;wMajorVerNum);
    pTypeLib-&gt;lpVtbl-&gt;ReleaseTLibAttr(pTypeLib, pTLibAttr);
    return major;
}</pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-minor_version" class="method-detail ">
                      <div class="method-heading">
                        <span class="method-callseq">
                          WIN32OLE_TYPELIB#minor_version &rarr; The type library minor version.
                              </span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Returns the type library minor version.</p>

<pre class="ruby"><span class="ruby-identifier">tlib</span> = <span class="ruby-constant">WIN32OLE_TYPELIB</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&#39;Microsoft Excel 9.0 Object Library&#39;</span>)
<span class="ruby-identifier">puts</span> <span class="ruby-identifier">tlib</span>.<span class="ruby-identifier">minor_version</span> <span class="ruby-comment"># -&gt; 3</span>
</pre>

                              <div class="method-source-code" id="minor_version-source">
            <pre>static VALUE
foletypelib_minor_version(VALUE self)
{
    TLIBATTR *pTLibAttr;
    VALUE minor;
    ITypeLib *pTypeLib;
    pTypeLib = itypelib(self);
    oletypelib_get_libattr(pTypeLib, &amp;pTLibAttr);
    minor =  RB_INT2NUM(pTLibAttr-&gt;wMinorVerNum);
    pTypeLib-&gt;lpVtbl-&gt;ReleaseTLibAttr(pTypeLib, pTLibAttr);
    return minor;
}</pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-name" class="method-detail ">
                      <div class="method-heading">
                        <span class="method-callseq">
                          WIN32OLE_TYPELIB#name &rarr; The type library name
                              </span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Returns the type library name.</p>

<pre class="ruby"><span class="ruby-identifier">tlib</span> = <span class="ruby-constant">WIN32OLE_TYPELIB</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&#39;Microsoft Excel 9.0 Object Library&#39;</span>)
<span class="ruby-identifier">name</span> = <span class="ruby-identifier">tlib</span>.<span class="ruby-identifier">name</span> <span class="ruby-comment"># -&gt; &#39;Microsoft Excel 9.0 Object Library&#39;</span>
</pre>

                              <div class="method-source-code" id="name-source">
            <pre>static VALUE
foletypelib_name(VALUE self)
{
    ITypeLib *pTypeLib;
    HRESULT hr;
    BSTR bstr;
    VALUE name;
    pTypeLib = itypelib(self);
    hr = pTypeLib-&gt;lpVtbl-&gt;GetDocumentation(pTypeLib, -1,
                                            NULL, &amp;bstr, NULL, NULL);

    if (FAILED(hr)) {
        ole_raise(hr, eWIN32OLERuntimeError, &quot;failed to get name from ITypeLib&quot;);
    }
    name = WC2VSTR(bstr);
    return name;
}</pre>
                              </div>
                            </div>

                            <div class="aliases">
                              Also aliased as: <a href="Typelib.html#method-i-to_s">to_s</a>
                            </div>

                          </div>

                  <div id="method-i-ole_classes" class="method-detail method-alias">
                      <div class="method-heading">
                        <span class="method-callseq">
                          WIN32OLE_TYPELIB#ole_types &rarr; The array of WIN32OLE_TYPE object included the type library.
                              </span>
                            </div>

                            <div class="method-description">
                              <p>Returns the type library file path.</p>

<pre class="ruby"><span class="ruby-identifier">tlib</span> = <span class="ruby-constant">WIN32OLE_TYPELIB</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&#39;Microsoft Excel 9.0 Object Library&#39;</span>)
<span class="ruby-identifier">classes</span> = <span class="ruby-identifier">tlib</span>.<span class="ruby-identifier">ole_types</span>.<span class="ruby-identifier">collect</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">k</span><span class="ruby-operator">|</span> <span class="ruby-identifier">k</span>.<span class="ruby-identifier">name</span>} <span class="ruby-comment"># -&gt; [&#39;AddIn&#39;, &#39;AddIns&#39; ...]</span>
</pre>

                            </div>


                            <div class="aliases">
                              Alias for: <a href="Typelib.html#method-i-ole_types">ole_types</a>
                            </div>
                          </div>

                  <div id="method-i-ole_types" class="method-detail ">
                      <div class="method-heading">
                        <span class="method-callseq">
                          WIN32OLE_TYPELIB#ole_types &rarr; The array of WIN32OLE_TYPE object included the type library.
                              </span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Returns the type library file path.</p>

<pre class="ruby"><span class="ruby-identifier">tlib</span> = <span class="ruby-constant">WIN32OLE_TYPELIB</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&#39;Microsoft Excel 9.0 Object Library&#39;</span>)
<span class="ruby-identifier">classes</span> = <span class="ruby-identifier">tlib</span>.<span class="ruby-identifier">ole_types</span>.<span class="ruby-identifier">collect</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">k</span><span class="ruby-operator">|</span> <span class="ruby-identifier">k</span>.<span class="ruby-identifier">name</span>} <span class="ruby-comment"># -&gt; [&#39;AddIn&#39;, &#39;AddIns&#39; ...]</span>
</pre>

                              <div class="method-source-code" id="ole_types-source">
            <pre>static VALUE
foletypelib_ole_types(VALUE self)
{
    ITypeLib *pTypeLib = NULL;
    VALUE classes = rb_ary_new();
    pTypeLib = itypelib(self);
    ole_types_from_typelib(pTypeLib, classes);
    return classes;
}</pre>
                              </div>
                            </div>

                            <div class="aliases">
                              Also aliased as: <a href="Typelib.html#method-i-ole_classes">ole_classes</a>
                            </div>

                          </div>

                  <div id="method-i-path" class="method-detail ">
                      <div class="method-heading">
                        <span class="method-callseq">
                          WIN32OLE_TYPELIB#path &rarr; The type library file path.
                              </span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Returns the type library file path.</p>

<pre class="ruby"><span class="ruby-identifier">tlib</span> = <span class="ruby-constant">WIN32OLE_TYPELIB</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&#39;Microsoft Excel 9.0 Object Library&#39;</span>)
<span class="ruby-identifier">puts</span> <span class="ruby-identifier">tlib</span>.<span class="ruby-identifier">path</span> <span class="ruby-comment">#-&gt; &#39;C:\...\EXCEL9.OLB&#39;</span>
</pre>

                              <div class="method-source-code" id="path-source">
            <pre>static VALUE
foletypelib_path(VALUE self)
{
    TLIBATTR *pTLibAttr;
    HRESULT hr = S_OK;
    BSTR bstr;
    LCID lcid = cWIN32OLE_lcid;
    VALUE path;
    ITypeLib *pTypeLib;

    pTypeLib = itypelib(self);
    oletypelib_get_libattr(pTypeLib, &amp;pTLibAttr);
    hr = QueryPathOfRegTypeLib(&amp;pTLibAttr-&gt;guid,
                               pTLibAttr-&gt;wMajorVerNum,
                               pTLibAttr-&gt;wMinorVerNum,
                               lcid,
                               &amp;bstr);
    if (FAILED(hr)) {
        pTypeLib-&gt;lpVtbl-&gt;ReleaseTLibAttr(pTypeLib, pTLibAttr);
        ole_raise(hr, eWIN32OLERuntimeError, &quot;failed to QueryPathOfRegTypeTypeLib&quot;);
    }

    pTypeLib-&gt;lpVtbl-&gt;ReleaseTLibAttr(pTypeLib, pTLibAttr);
    path = WC2VSTR(bstr);
    return path;
}</pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-to_s" class="method-detail method-alias">
                      <div class="method-heading">
                        <span class="method-callseq">
                          WIN32OLE_TYPELIB#name &rarr; The type library name
                              </span>
                            </div>

                            <div class="method-description">
                              <p>Returns the type library name.</p>

<pre class="ruby"><span class="ruby-identifier">tlib</span> = <span class="ruby-constant">WIN32OLE_TYPELIB</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&#39;Microsoft Excel 9.0 Object Library&#39;</span>)
<span class="ruby-identifier">name</span> = <span class="ruby-identifier">tlib</span>.<span class="ruby-identifier">name</span> <span class="ruby-comment"># -&gt; &#39;Microsoft Excel 9.0 Object Library&#39;</span>
</pre>

                            </div>


                            <div class="aliases">
                              Alias for: <a href="Typelib.html#method-i-name">name</a>
                            </div>
                          </div>

                  <div id="method-i-version" class="method-detail ">
                      <div class="method-heading">
                        <span class="method-callseq">
                          WIN32OLE_TYPELIB#version &rarr; The type library version String object.
                              </span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Returns the type library version.</p>

<pre class="ruby"><span class="ruby-identifier">tlib</span> = <span class="ruby-constant">WIN32OLE_TYPELIB</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&#39;Microsoft Excel 9.0 Object Library&#39;</span>)
<span class="ruby-identifier">puts</span> <span class="ruby-identifier">tlib</span>.<span class="ruby-identifier">version</span> <span class="ruby-comment">#-&gt; &quot;1.3&quot;</span>
</pre>

                              <div class="method-source-code" id="version-source">
            <pre>static VALUE
foletypelib_version(VALUE self)
{
    TLIBATTR *pTLibAttr;
    ITypeLib *pTypeLib;
    VALUE version;

    pTypeLib = itypelib(self);
    oletypelib_get_libattr(pTypeLib, &amp;pTLibAttr);
    version = rb_sprintf(&quot;%d.%d&quot;, pTLibAttr-&gt;wMajorVerNum, pTLibAttr-&gt;wMinorVerNum);
    pTypeLib-&gt;lpVtbl-&gt;ReleaseTLibAttr(pTypeLib, pTLibAttr);
    return version;
}</pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-visible-3F" class="method-detail ">
                      <div class="method-heading">
                        <span class="method-callseq">
                          WIN32OLE_TYPELIB#visible?
                              </span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Returns true if the type library information is not hidden. If wLibFlags of TLIBATTR is 0 or LIBFLAG_FRESTRICTED or LIBFLAG_FHIDDEN, the method returns false, otherwise, returns true. If the method fails to access the TLIBATTR information, then <a href="../WIN32OLERuntimeError.html"><code>WIN32OLERuntimeError</code></a> is raised.</p>

<pre class="ruby"><span class="ruby-identifier">tlib</span> = <span class="ruby-constant">WIN32OLE_TYPELIB</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&#39;Microsoft Excel 9.0 Object Library&#39;</span>)
<span class="ruby-identifier">tlib</span>.<span class="ruby-identifier">visible?</span> <span class="ruby-comment"># =&gt; true</span>
</pre>

                              <div class="method-source-code" id="visible-3F-source">
            <pre>static VALUE
foletypelib_visible(VALUE self)
{
    ITypeLib *pTypeLib = NULL;
    VALUE visible = Qtrue;
    TLIBATTR *pTLibAttr;

    pTypeLib = itypelib(self);
    oletypelib_get_libattr(pTypeLib, &amp;pTLibAttr);

    if ((pTLibAttr-&gt;wLibFlags == 0) ||
        (pTLibAttr-&gt;wLibFlags &amp; LIBFLAG_FRESTRICTED) ||
        (pTLibAttr-&gt;wLibFlags &amp; LIBFLAG_FHIDDEN)) {
        visible = Qfalse;
    }
    pTypeLib-&gt;lpVtbl-&gt;ReleaseTLibAttr(pTypeLib, pTLibAttr);
    return visible;
}</pre>
                              </div>
                            </div>


                          </div>

                          </section>

              </section>
              </main>



            </div>  <!--  class='wrapper hdiv' -->


<footer id="validator-badges" role="contentinfo">
<p><a href="https://validator.w3.org/check/referer">Validate</a></p>
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.</p>
<p>Based on <a href="https://github.com/ged/darkfish/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.</p>

  
    <p><p><a href="https://ruby-doc.org">Ruby-doc.org</a> is provided by <a href="https://jamesbritt.com">James Britt</a> and <a href="https://neurogami.com">Neurogami</a>.</p><p><a href="https://jamesbritt.bandcamp.com/">Maximum R+D</a>.  </p>
</p>
  
  </footer>

<script type="text/javascript">


  let ads  = $("#carbonads-container").children().detach();


  function swapMode() {
    var cookieName = 'darkmode';
    var cssDarkmode = Cookies.get(cookieName);
    console.log("***** swapMode! " + cssDarkmode + " *****");


    if (cssDarkmode == "true") {
      console.log("We have dark mode, set the css to light ...");
      $('#rdoccss').attr("href", defaultModeCssHref);
      $('#cssSelect').text("Dark mode");
      cssDarkmode = "false";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    } else {
      console.log("We not have dark mode, set the css to dark ...");
      $('#rdoccss').attr("href", darkModeCsseHref);
      $('#cssSelect').text("Light mode");
      cssDarkmode = "true";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    }

    console.log("  --------------- ");
  }


const vueCssApp = new Vue({
el: '#menubar',
data: {
isDark: false
},
methods: {
toggleClass: function(event){
this.isDark = !this.isDark;
}
}
})

const vueApp = new Vue({
el: '#vapp',
data: { 
isOpen: true
},

mounted() {
this.handleResize();
this.manage_mob_classes();
window.addEventListener('resize', this.handleResize)
//this.isOpen !=  (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},
destroyed() {
window.removeEventListener('resize', this.handleResize)
},
created() {
//manage_mob_classes();
},

methods : {
isMobile() {
  return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},

  handleResize() {
    if (!this.isMobile()) {
      this.isOpen = window.innerWidth > 800;
    }
  },

  manage_mob_classes() {
    if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
      $("nav").addClass("mob_nav");
      $("main").addClass("mob_main");
      $("#extraz").addClass("mob_extraz");
      $("#carbonads-container").addClass("mob_carbonads-container");
      this.isOpen  = false;
    } else {
      $("nav").removeClass("mob_nav") 
        $("main").removeClass("mob_main");
      $("#extraz").removeClass("mob_extraz");
      $("#carbonads-container").removeClass("mob_carbonads-container");
      this.isOpen  = true;
    }
  },

  toggleNav() {
    this.isOpen =! this.isOpen ;
    // alert("Toggle nav!");
    console.log("toggleNav() click: " + this.isOpen );
  }
}
})

$("#carbonads-container").append(ads);


$(function() {

    var darkmode = Cookies.get("darkmode");
    console.log("Document ready: " + darkmode);

    if ( darkmode  == "true" ) {
      $('#cssSelect').text("Light mode");
    } else {
      $('#cssSelect').text("Dark mode");
     }

    $('body').css('display','block');
    });

</script>

    
  </body> 
</html>

